//
//  ZMHorizontalGridView.h
//  Pods
//
//  Created by pg on 2017/9/13.
//
//

#import <UIKit/UIKit.h>



@class ZMHorizontalGridView;
//数据源协议
@protocol ZMHorizontalGridViewDataSource <NSObject>

//提供网格数量的代理方法
-(NSInteger)numberOfItemsInHorizontalGridView:(ZMHorizontalGridView*)horizontalGridView;
//提供图标路径的代理方法
-(NSURL*)horizontalGridView:(ZMHorizontalGridView*)horizontalGridView urlForItemAtIndex:(NSInteger)index;

//提供每个网格的标题
-(NSString*)horizontalGridView:(ZMHorizontalGridView*)horizontalGridView titleForItemAtIndex:(NSInteger)index;



@end
//数据源协议
@protocol ZMHorizontalGridViewDelegate <NSObject>

//返回列数
-(NSInteger)numberOfColumsInHorizontalGridView:(ZMHorizontalGridView*)horizontalGridView;
//返回行数
-(NSInteger)numberOfRowsInHorizontalGridView:(ZMHorizontalGridView*)horizontalGridView;

@end


//自定义网格类
@interface ZMHorizontalGridView : UIView

//默认图片
@property (strong, nonatomic)   UIImage         *defaultIconImage;

@property (strong, nonatomic)   UIColor         *mainColor;



//数据源代理属性
@property(nonatomic,weak)id<ZMHorizontalGridViewDelegate>delegate;

@property(nonatomic,weak)id<ZMHorizontalGridViewDataSource>dataSource;

//刷新数据
-(void)reloadData;


@end
